package com.kai.controller;

import com.kai.pojo.SlideShow;
import com.kai.service.SlideShowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class SlideShowController {
    @Autowired
    private SlideShowService slideShowService;

    /**
     * 查询全部轮播图
     * @return
     */
    @GetMapping("/selectAllSlideShow")
    @ResponseBody
    public List<SlideShow> selectAllSlideShow() {
        return slideShowService.selectAllSlideShow();
    }
    /**
     * 修改轮播图
     * @return
     */
    @PostMapping("/updateSlideShow")
    @ResponseBody
    public int updateSlideShow(@RequestBody SlideShow slideShow) {
        return slideShowService.updateSlideShow(slideShow);
    }
}
